]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
popupMenu: Don't slide menus when we're changing them
authorJasper St. Pierre <jstpierre@mecheye.net>
Mon, 10 Dec 2012 08:55:14 +0000 (03:55 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Mon, 10 Dec 2012 19:38:07 +0000 (14:38 -0500)
As calling close() will drop the grab, we were inadverdently
re-closing menus, causing them to re-animate with a full animation.

https://bugzilla.gnome.org/show_bug.cgi?id=689954

js/ui/grabHelper.js
js/ui/popupMenu.js

index 6e1c54c347d2a3b63cde4fb9f25078bc808ac041..9c8df702dbb968f2ca6b99985580c61e4a68c101 100644 (file)
@@ -280,7 +280,8 @@ const GrabHelper = new Lang.Class({
     // If the actor that was popped from the grab stack was not the actor
     // That was passed in, this call is ignored.
     ungrab: function(params) {
-        params = Params.parse(params, { actor: this.currentGrab.actor });
+        params = Params.parse(params, { actor: this.currentGrab.actor,
+                                        isUser: false });
 
         let grabStackIndex = this._findStackIndex(params.actor);
         if (grabStackIndex < 0)
@@ -298,7 +299,7 @@ const GrabHelper = new Lang.Class({
             let poppedGrab = poppedGrabs[i];
 
             if (poppedGrab.onUngrab)
-                poppedGrab.onUngrab();
+                poppedGrab.onUngrab(params.isUser);
 
             if (poppedGrab.modal)
                 this._releaseModalGrab();
@@ -329,7 +330,7 @@ const GrabHelper = new Lang.Class({
 
         if (type == Clutter.EventType.KEY_PRESS &&
             event.get_key_symbol() == Clutter.KEY_Escape) {
-            this.ungrab();
+            this.ungrab({ isUser: true });
             return true;
         }
 
@@ -345,7 +346,7 @@ const GrabHelper = new Lang.Class({
             if (press)
                 this._ignoreRelease = true;
             let i = this._actorInGrabStack(event.get_source()) + 1;
-            this.ungrab({ actor: this._grabStack[i].actor });
+            this.ungrab({ actor: this._grabStack[i].actor, isUser: true });
         }
 
         return this._modalCount > 0;
@@ -354,12 +355,12 @@ const GrabHelper = new Lang.Class({
     _onKeyFocusChanged: function() {
         let focus = global.stage.key_focus;
         if (!focus || !this._isWithinGrabbedActor(focus))
-            this.ungrab();
+            this.ungrab({ isUser: true });
     },
 
     _focusWindowChanged: function() {
         let metaDisplay = global.screen.get_display();
         if (metaDisplay.focus_window != null)
-            this.ungrab();
+            this.ungrab({ isUser: true });
     }
 });
index 202ae3d35fdaa6bae6167d2ab1e7f4057078e963..ba17b270dd3e23d0272f399a59fa0d01acba28fe 100644 (file)
@@ -2173,7 +2173,11 @@ const PopupMenuManager = new Lang.Class({
         return -1;
     },
 
-    _closeMenu: function(menu) {
-        menu.close(BoxPointer.PopupAnimation.FULL);
+    _closeMenu: function(isUser, menu) {
+        // If this isn't a user action, we called close()
+        // on the BoxPointer ourselves, so we shouldn't
+        // reanimate.
+        if (isUser)
+            menu.close(BoxPointer.PopupAnimation.FULL);
     }
 });